package com.xnew.utils;

import org.apache.axis.client.Call;
import org.apache.axis.client.Service;

/**
 * Webservice工具类
 * 
 * @author huanghai3
 *
 */
public class ServiceClient {

	/**
	 * ESB服务调用公共方法
	 * 
	 * @param nameSpaceUri
	 * @param params
	 * @param method
	 * @return
	 */
	public static String poxy(String nameSpaceUri, String params, String method) {
		String returnMessagr = "无返回信息";
		Service service = new Service();
		try {
			Call call = (Call) service.createCall();
			call.setTargetEndpointAddress(nameSpaceUri);
			call.setOperation(method);
			returnMessagr = (String) call.invoke(new Object[] { params });
		} catch (Exception e) {
			returnMessagr = "调用客户端异常";
			e.printStackTrace();
		}
		return returnMessagr;
	}

	/**
	 * 功能描述：调用
	 * 
	 */
	public static void main(String[] args) {}
}
